package com.qiwx.pigeon.adapter.query;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.qiwx.pigeon.R;
import com.qiwx.pigeon.adapter.home.ICageInterface;
import com.qiwx.pigeon.data.CageStatusConfig;
import com.qiwx.pigeon.data.vo.CageProduceBean;
import com.qiwx.pigeon.data.vo.FertilizeBean;

import java.util.List;

/**
 * @description
 * @Author qiwx
 * @Date 2020-04-08 11:35
 * 下蛋记录
 **/
public class LayEggRecordAdapter extends BaseQuickAdapter<CageProduceBean, BaseViewHolder> {
    ICageInterface iCageInterface;

    public LayEggRecordAdapter(int layoutResId, List<CageProduceBean> data) {
        super(layoutResId, data);
    }

    public void setiCageInterface(ICageInterface iCageInterface) {
        this.iCageInterface = iCageInterface;
    }

    @Override
    protected void convert(BaseViewHolder holder, CageProduceBean bean) {

        holder.setText(R.id.txt_lay_date, bean.getLay_egg_date());
        int egg_status = bean.getEgg_status();
        int brokenEgg = bean.getYd_breaken() + bean.getCd_breaken() + bean.getFd_breaken() + bean.getCz_breaken();
        int wd = bean.getYd_wd() + bean.getCd_wd() + bean.getFd_wd() + bean.getCz_wdwz();
        int badEgg = bean.getYd_bad() + bean.getCd_bad() + bean.getFd_bad() + bean.getCz_bad();

        holder.setText(R.id.txt_shoujing, CageStatusConfig.getDesByEggStatus(egg_status));
        holder.setText(R.id.txt_wudan, wd + "");
        holder.setText(R.id.txt_bad_egg, "" + badEgg);
        holder.setText(R.id.txt_nofudan, "" + brokenEgg);


    }
}
